/*****************************************************************************

FileName: <vidout.h>

Description:
VideoOut Functions

*****************************************************************************/

#ifndef _VIDOUT_H
#define _VIDOUT_H



/* Display Device Structure */
/* ======================== */

typedef struct DisplayDevice
{
	unsigned char *pInBuffer;
	unsigned char *pOutBuffer;

	unsigned int nFrameWidth;
	unsigned int nFrameHeight;
	unsigned int nTextureWidth;
	unsigned int nTextureHeight;
	double nRelWidth;
	double nRelHeight;

	int nInFmt;

	int nRunning;
	long nFrameNum;
	double nTime;
	double nFrameRate;
}DisplayDevice;


/* Variables declared in Library */
extern int textureid;


/* Initialisation Function */
void vidoutInit();


/* Functions for Video Display */
/* ============================*/

/* YUV 420 to RGBA */
void yuv420ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yuv420IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu420ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu420IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);


/* YUV 422 to RGBA */
void yuv422ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yuv422IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu422ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu422IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);

void uyvyProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void uyvyIntPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yuyvProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yuyvIntPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvyuProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvyuIntPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);


/* YUV 444 to RGBA */
void yuv444ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yuv444IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu444ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu444IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void uyv444ProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void uyv444IntPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);

void yuv444ProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yuv444IntPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu444ProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void yvu444IntPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void uyv444ProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void uyv444IntPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);


/* RGB to RGBA */
void rgbProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void rgbProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void bgrProgPlanarToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);
void bgrProgPackedToRGBA(unsigned char *bufsrc, unsigned char *bufdest,int width, int height, int texwidth, int texheight);



/* Video Out Functions */
void DisplayDevInit(DisplayDevice *);
void DisplayFrame(DisplayDevice *);


#endif


